Update shadcn theme and fix/standardize styling#2193
Conversation
The contrast of the current values is unacceptable and the themes demo page is using these new values
Now it uses "focus-visible:ring-[3px] focus-visible:ring-ring/50" like everything else
This was only affecting ListItem, which isn't using an outline anymore. So, the issue doesn't currently affect us, but it was VERY confusing.
|
Important Review skippedAuto incremental reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
📝 WalkthroughWalkthroughThis PR switches color models from HSL to OKLCH in styling, restructures the theme configuration from a single theme to multiple data-theme-driven variants, simplifies the ThemePicker component API by replacing buttonProps with a variant prop, refactors ListItem and button styling with new border-based selection indicators and focus handling, removes focus ring injection from input components, and updates writing system color constants to darker accent families. Changes
Estimated code review effort🎯 4 (Complex) | ⏱️ ~45 minutes Possibly related PRs
Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Tip Try Coding Plans. Let us write the prompt for your AI agent so you can ship faster (with fewer bugs). Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
The latest updates on your projects. Learn more about Argos notifications ↗︎
|
There was a problem hiding this comment.
Actionable comments posted: 2
🧹 Nitpick comments (1)
frontend/viewer/src/project/browse/sort/SortMenu.svelte (1)
51-51: Avoid composing both badge and button variant systems on one trigger.
buttonVariants(...xs...)andbadgeVariants(...)carry overlapping sizing/spacing/text utilities, so the final style depends on class-order collisions. Consider using one source of truth (preferbuttonVariants) and add explicit badge-like overrides only as needed.♻️ Suggested cleanup
- <ResponsiveMenu.Trigger class={cn(buttonVariants({variant: 'secondary', size: 'xs'}), badgeVariants({ variant: 'secondary' }), 'border-none h-7')}> + <ResponsiveMenu.Trigger + class={cn( + buttonVariants({ variant: 'secondary', size: 'xs' }), + 'h-7 rounded-full px-2 text-xs border-none' + )} + >🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@frontend/viewer/src/project/browse/sort/SortMenu.svelte` at line 51, The trigger currently composes both buttonVariants and badgeVariants (ResponsiveMenu.Trigger with cn(buttonVariants(...), badgeVariants(...))), causing conflicting sizing/spacing; remove badgeVariants usage and rely on buttonVariants({ variant: 'secondary', size: 'xs' }) as the single source of truth, then add any explicit badge-like overrides (e.g., small padding, rounded-full, text-xs) directly in the class string or via a small helper so ResponsiveMenu.Trigger styling is deterministic and does not depend on class order.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@frontend/viewer/src/lib/components/ListItem.svelte`:
- Line 42: Replace the invalid Tailwind utility "border-l-5" used in the class
string (the segment containing "border-l-5 border-l-transparent
aria-selected:border-l-primary" in ListItem.svelte) with a valid utility; either
use the arbitrary value "border-l-[5px]" if a 5px left border is required or
"border-l-4" if the design intends the nearest standard width, and keep the rest
of the classes ("border-l-transparent" and "aria-selected:border-l-primary")
unchanged.
In `@frontend/viewer/src/stories/editor/fields/ws-colors.stories.svelte`:
- Around line 21-23: Remove the stray debug text "asd" that was accidentally
left inside the story template rendering; locate the snippet where template() is
used (the block containing "{`#snippet` template()}" and the surrounding <div
class="flex flex-col gap-8 p-4">) and delete the standalone "asd" so only the
intended markup from template() and the div remain.
---
Nitpick comments:
In `@frontend/viewer/src/project/browse/sort/SortMenu.svelte`:
- Line 51: The trigger currently composes both buttonVariants and badgeVariants
(ResponsiveMenu.Trigger with cn(buttonVariants(...), badgeVariants(...))),
causing conflicting sizing/spacing; remove badgeVariants usage and rely on
buttonVariants({ variant: 'secondary', size: 'xs' }) as the single source of
truth, then add any explicit badge-like overrides (e.g., small padding,
rounded-full, text-xs) directly in the class string or via a small helper so
ResponsiveMenu.Trigger styling is deterministic and does not depend on class
order.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Pro
Run ID: 5bbbb19b-46ed-48ed-8fc6-bf8da048c897
📒 Files selected for processing (18)
frontend/viewer/src/app.cssfrontend/viewer/src/home/AppBar.sveltefrontend/viewer/src/home/HomeView.sveltefrontend/viewer/src/home/ProjectListItem.sveltefrontend/viewer/src/lib/components/ListItem.sveltefrontend/viewer/src/lib/components/ThemePicker.sveltefrontend/viewer/src/lib/components/ui/button/button.sveltefrontend/viewer/src/lib/components/ui/input/composable-input.sveltefrontend/viewer/src/lib/components/ui/input/input-shell.sveltefrontend/viewer/src/lib/components/ui/input/input.sveltefrontend/viewer/src/project/ProjectSidebar.sveltefrontend/viewer/src/project/browse/EntryView.sveltefrontend/viewer/src/project/browse/sort/SortMenu.sveltefrontend/viewer/src/project/data/writing-system-service.svelte.tsfrontend/viewer/src/project/demo/demo-entry-data.tsfrontend/viewer/src/stories/editor/fields/ws-colors.stories.sveltefrontend/viewer/src/theme.cssfrontend/viewer/tailwind.config.ts
💤 Files with no reviewable changes (1)
- frontend/viewer/tailwind.config.ts
* Update to latest shadcn themes * Fix broken theme values The contrast of the current values is unacceptable and the themes demo page is using these new values * Improve theme-picker trigger contrast on home page * Adapt ListItem to new theme colors * Fix: dark outline button border color * Adapt ghost and shell inputs to new shadcn theme * Use button styling for sort badge-button * Redesign ListItem states Now it uses "focus-visible:ring-[3px] focus-visible:ring-ring/50" like everything else * Fix broken outlines in dark mode This was only affecting ListItem, which isn't using an outline anymore. So, the issue doesn't currently affect us, but it was VERY confusing. * Improve writing system contrast * Fix Add sense button outline cropped * Improve primary color contrast * Add story for demoing theme colors
Various screenshots:




EDIT: the theme colours above are partially out of date. I improved the contrast of some of the primary colours and added a story to demo them:
